package il.ac.technion.wiki.api.search;


/**
 * Represents a search expression that must contain <i>at least one of</i> the specified
 * search expressions.
 */
public class OrSearchExpression implements ISearchExpression {
	@Override
	public int numberOfOperands() {
		return 2;
	}

	@Override
	public String toString() {
		return "{"+left.toString()+"} <--OR--> {"+right.toString()+"}";
	}

	/**
	 * Creates a new OrSearchExpression.
	 * @param left	The left subtree of the search tree.
	 * @param right	The right subtree of the search tree.
	 */
	public OrSearchExpression(ISearchExpression left, ISearchExpression right) {
		this.left = left;
		this.right = right;
	}
	
	/**
	 * The two sub-expressions, one of which must appear to match this search expression.
	 */
	public final ISearchExpression left, right;
}
